package com.jojo.android.mylibrary.math;


/**
 * @author zx
 * 2020/12/29 19:49
 **/

public class MathTool {

    public static void main(String... arg) {
        System.out.println(CalPoint(5,2,30,50,50));
    }


    /**
     * @param radius   半径
     * @param arcAngle 弧度
     * @param x        圆原点x
     * @param y        圆原点y
     * @return
     */
    private static Point CalPoint(double radius, double spacing, double arcAngle, float x, float y) {
        //弧起始点
        Point src = new Point(y - radius, x);
        Point target = new Point();
        target.x = radius + spacing;
        target.y = Math.tan(arcAngle / 2) * target.x;
        return target;
    }


    public static class Point {
        double x, y;

        public Point(double x, double y) {
            this.x = x;
            this.y = y;
        }

        public Point() {

        }

        public double getX() {
            return x;
        }

        public void setX(double x) {
            this.x = x;
        }

        public double getY() {
            return y;
        }

        public void setY(double y) {
            this.y = y;
        }

        @Override
        public String toString() {
            return "Point{" +
                    "x=" + x +
                    ", y=" + y +
                    '}';
        }
    }
}
